feature: Hide PosixDiskEnv
type behind a feature (default enabled)
#38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Building
rusty-leveldb
in constrained or non-POSIX environments (such as WASM) is currently not possible.This PR adds small changes to make it possible.
Changes
Introduces
fs
feature which is enabled by default. The feature allows to toggle thePosixDiskEnv
type and therefore makes it possible to buildrusty-leveldb
on systems wherestd::io
is constrained. One major use case are WASM environments. Users can therefore setuse-default-features = false
onrusty-leveldb
dependency entries in theirCargo.toml
. The only availableEnv
will beMemEnv
iffs
feature is disabled.Updates
rand
crate to version0.8.5
which is also WASM compatible. When the users ofrusty-leveldb
addgetrandom
dependency to theirCargo.toml
, it will make the random number generation inrusty-leveldb
work on their platform.Adds
crate-type
to allow builds in different environmentsRe-exports
FileLock
,RandomAccessFile
andLogger
types so that users can add custom implementation of theEnv
trait.